package com.chinasi.web.action;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.chinasi.model.AgencyBasic;
import com.chinasi.model.ConsultBasic;
import com.chinasi.model.ConsumerBasic;
import com.chinasi.model.ExpertBasic;
import com.chinasi.model.IndustryInfo;
import com.chinasi.model.IntegratorBasic;
import com.chinasi.model.ProductInfo;
import com.chinasi.model.ProjectInfo;
import com.chinasi.model.SupervisionBasic;
import com.chinasi.service.AgencyBasicService;
import com.chinasi.service.BidBasicService;
import com.chinasi.service.ConsultBasicService;
import com.chinasi.service.ConsumerBasicService;
import com.chinasi.service.ExpertBasicService;
import com.chinasi.service.IndustryInfoService;
import com.chinasi.service.IntegratorBasicService;
import com.chinasi.service.ProductInfoService;
import com.chinasi.service.ProjectInfoService;
import com.chinasi.service.SupervisionBasicService;

@Controller
@RequestMapping("/")
public class IndexAction {

	/**
	 * WowBidBasicService
	 */
	@Autowired
	private BidBasicService wowBidBasicService;
	
	@Autowired
	private IndustryInfoService industryInfoService;
	
	@Autowired
	private ProjectInfoService projectService;
	
	@Autowired
	private ProductInfoService productService;
	
	@Autowired
	private ConsumerBasicService consumerService;
	
	@Autowired
	private ConsultBasicService consultService;
	
	@Autowired
	private ExpertBasicService expertService;
	
	@Autowired
	private IntegratorBasicService integratorService;
	
	@Autowired
	private AgencyBasicService agencyServcie;
	
	@Autowired
	private SupervisionBasicService supervisionService;
	
	/** 首页 **/
	@RequestMapping("index")
	public ModelAndView index(){
		Map<String, Object> model = new HashMap<String, Object>();
		
		//项目列表
		model.put("bidList", wowBidBasicService.findPage(1));
		
		//行业资讯
		model.put("infoList", industryInfoService.findPageCondition(new IndustryInfo(),1));
		
		//解决方案
		model.put("projectList", projectService.findPageCondition(new ProjectInfo(),1));
		
		//创新产品
		model.put("productList", productService.findPageCondition(new ProductInfo(),1));
		
		//产业档案
		model.put("consumerList", consumerService.findPageCondition(new ConsumerBasic(), 1));
		model.put("consultList", consultService.findPageCondition(new ConsultBasic(), 1));
		model.put("expertList", expertService.findPageCondition(new ExpertBasic(), 1));
		model.put("integratorList", integratorService.findPageCondition(new IntegratorBasic(), 1));
		model.put("agencyList", agencyServcie.findPageCondition(new AgencyBasic(), 1));
		model.put("supervisionList", supervisionService.findPageCondition(new SupervisionBasic(), 1));
		
		return new ModelAndView("index",model);
	}
}
